package count_time;

public class Main {
    public static void main(String[] args) throws Exception{
        CountdownThread countdownThread = new CountdownThread();
        countdownThread.start();
        countdownThread.join();
        //20230404430920沈泽华
        Thread thread = new Thread(){
            @Override
            public void run() {
                System.out.println("倒计时结束！");
            }
        };
        thread.start();
    }
}

class CountdownThread extends Thread{
    @Override
    public void run() {
        for (int i = 10; i >= 0 ; i--) {
            System.out.println("倒计时"+i+"s");
            try {
                sleep(1000);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
}
